Problems tagged with "feature maps"

Problem #61

Tags: feature maps, linear prediction functions

Suppose a linear prediction function \(H(\vec x) = w_1 \phi_1(\vec x) + w_2 \phi_2(\vec x) + w_3 \phi_3(\vec x) + w_4 \phi_4(\vec x)\) is fit using the basis functions

\[\phi_1(\vec x) = 1, \quad\phi_2(\vec x) = x_1^2, \quad\phi_3(\vec x) = x_2^2, \quad\phi_4(\vec x) = x_1 x_2, \]

where \(\vec x = (x_1, x_2)^T\) is a feature vector in \(\mathbb R^2\). The weight vector \(\vec w\) is found to be \(\vec w = (1, -2, 3, -4)^T\).

Let \(\vec x = (1, 2)^T\). What is \(H(\vec x)\)?

Solution

We have:

\[\begin{align*} H(\vec x) &= w_1 \phi_1(\vec x) + w_2 \phi_2(\vec x) + w_3 \phi_3(\vec x) + w_4 \phi_4(\vec x) \\ &= 1 \times 1 + (-2) \times x_1^2 + 3 \times x_2^2 + (-4) \times x_1 \times x_2 \\ &= 1 \times 1 + (-2) \times 1^2 + 3 \times 2^2 + (-4) \times 1 \times 2 \\ &= 1 - 2 + 12 - 8 = 3. \end{align*}\]

Problem #79

Tags: feature maps, linear prediction functions

Suppose a linear prediction function \(H(\vec x) = w_1 \phi_1(\vec x) + w_2 \phi_2(\vec x) + w_3 \phi_3(\vec x) + w_4 \phi_4(\vec x)\) is fit using the basis functions

\[\phi_1(\vec x) = 1, \quad\phi_2(\vec x) = x_1 x_2, \quad\phi_3(\vec x) = x_2 x_3, \quad\phi_4(\vec x) = x_1 x_3, \]

where \(\vec x = (x_1, x_2, x_3)^T\) is a feature vector in \(\mathbb R^3\). The weight vector \(\vec w\) is found to be \(\vec w = (2, 1, -2, -3)^T\).

Let \(\vec x = (1, 2, 1)^T\). What is \(H(\vec x)\)?